/*
 * MovableObject.h
 *
 *  Created on: 29 de Abr de 2012
 *      Author: Rui
 */

#ifndef MOVABLEOBJECT_H_
#define MOVABLEOBJECT_H_

#include "GameObject.h"

namespace pacman {

typedef Vector2D_struct Vector2D;
struct Vector2D_struct{
	double x;
	double y;
};

enum direction{
	UP,
	DOWN,
	LEFT,
	RIGHT,
	NONE
};

class MovableObject: public GameObject {
	int _lastTime;
	direction _pressedDirection;
	direction _movingDirection;
	double _velocity;
	Vector2D _mapPosition;
	Vector2D _newMapPosition;



public:
	MovableObject();
	virtual ~MovableObject();

	virtual void draw() = 0;

	virtual void update();

	virtual void goLeft(){ _pressedDirection=LEFT;}
	virtual void goRight(){ _pressedDirection=RIGHT;}
	virtual void goUp(){ _pressedDirection=UP;}
	virtual void goDown(){ _pressedDirection=DOWN;}

	int getLastTime() const {
		return _lastTime;
	}

	void setLastTime(int lastTime) {
		_lastTime = lastTime;
	}

	direction getMovingDirection() const {
		return _movingDirection;
	}

	void setMovingDirection(direction movingDirection) {
		_movingDirection = movingDirection;
	}

	direction getPressedDirection() const {
		return _pressedDirection;
	}

	void setPressedDirection(direction pressedDirection) {
		_pressedDirection = pressedDirection;
	}

	double getVelocity() const {
		return _velocity;
	}

	void setVelocity(double velocity) {
		_velocity = velocity;
	}

};

} /* namespace pacman */
#endif /* MOVABLEOBJECT_H_ */
